﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Inner.Master" CodeBehind="AppointmentDetails.aspx.vb" Inherits="LecturerAppointmentSystem.AppointmentDetails" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
<asp:MultiView ID ="AppointmentDetailsMultiView" runat="server">
<asp:View ID="LecturerView" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="AppointmentDetailsDataSource" EnableModelValidation="True">
        <Columns>
            <asp:BoundField DataField="AppointmentDate" HeaderText="Appointment Date" 
                SortExpression="AppointmentDate" />
            <asp:BoundField DataField="Fkid_TimeSlot" HeaderText="Time" 
                SortExpression="Fkid_TimeSlot" />
            <asp:BoundField DataField="Place" HeaderText="Place" SortExpression="Place" />
            <asp:BoundField DataField="Agenda" HeaderText="Agenda" 
                SortExpression="Agenda" />
            <asp:BoundField DataField="BookedBy" HeaderText="Booked By" 
                SortExpression="BookedBy" />
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                SortExpression="ID" Visible="false"/>
        </Columns>
    </asp:GridView>
    <br />
    <asp:Button ID="btn_Reschedule" runat="server" Text="Reschedule" />
    <br />
    <asp:Button ID="btn_Cancel" runat="server" Text="Cancel Appointment" />

    <asp:Button ID="btnShowReschedulePopup" runat="server" Style="display: none" />
<asp:ModalPopupExtender ID="ReschedulePopup" runat="server" TargetControlID="btnShowReschedulePopup"
        PopupControlID="ReschedulePanel" CancelControlID="ButtonNo"></asp:ModalPopupExtender>
    <asp:Panel ID="ReschedulePanel" runat="server" Style="display: none; width: 200px; background-color: White;
        border-width: 2px; border-color: Black; border-style: solid; padding: 20px;">
        <asp:Label ID="RescheduleLabel" runat="server" Text="Are you sure you want to reschedule this appointment?"></asp:Label>
       <br />
        <br />
        <div style="text-align: right;">
            <asp:Button ID="ButtonYes" runat="server" Text="Yes" CommandName="Yes" OnClick="ButtonYes_Click" />
            <asp:Button ID="ButtonNo" runat="server" Text="No" />
        </div>
    </asp:Panel>
    <asp:SqlDataSource ID="AppointmentDetailsDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AppointmentsConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:AppointmentsConnectionString.ProviderName %>" 
        SelectCommand="SELECT [AppointmentDate], [Fkid_TimeSlot], [Place], [Agenda], [BookedBy], [ID] FROM [BookedSlotsQuery] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    </asp:View>
    </asp:MultiView>
</asp:Content>
